<template>
  <div class="info-panel-container">
    <!-- 左侧板块（调整为与中间一致） -->
    <div
        class="info-panel left-panel"
        @mouseenter="hoverIndex = 0"
        @mouseleave="hoverIndex = -1"
        @click="handlePanelClick(0)"
    >
      <div class="panel-image">
        <img src="https://tt-kiku-pic.oss-cn-beijing.aliyuncs.com/20250812/e30585d07c8c4d64a3796eff4252a37a.jpg" alt="成立个人工作室，自立门户">
        <div class="image-overlay" :class="{ 'hover': hoverIndex === 0 }"></div>
      </div>
      <div class="panel-content">
        <h3 class="panel-title">成立个人工作室，自立门户</h3>
        <p class="panel-desc">在与前东家丝芭传媒合约到期后，鞠婧祎于 2024 年 12 月 成立了“上海橘事顺利影视文化工作室”，成为独立艺人并全面掌控自己的演艺事业。</p>
      </div>
      <div class="panel-date">2024 年 12 月</div>
      <div class="panel-hover-overlay"></div>
    </div>

    <!-- 中间图片板块 -->
    <div
        class="info-panel image-panel"
        @mouseenter="hoverIndex = 1"
        @mouseleave="hoverIndex = -1"
        @click="handlePanelClick(1)"
    >
      <div class="panel-image">
        <img src="https://tt-kiku-pic.oss-cn-beijing.aliyuncs.com/20250812/36b9d9253e7b401baf1d8cfa4ed071d0.jpg" alt="主演《芸汐传》《新白娘子传奇》走红">
        <div class="image-overlay" :class="{ 'hover': hoverIndex === 1 }"></div>
      </div>
      <div class="panel-content">
        <h3 class="panel-title">主演《芸汐传》《新白娘子传奇》走红</h3>
        <p class="panel-desc">2018 年，鞠婧祎主演古装剧 《芸汐传》，凭借“韩芸汐”一角获得广泛好评。2019 年，她在 《新白娘子传奇》 中饰演“白素贞”，该剧在网络平台播放量破百亿，进一步奠定了她在古装剧领域的地位。</p>
      </div>
      <div class="panel-date">2018 年 6 月 25 日 / 2019 年 4 月 3 日</div>
      <div class="panel-hover-overlay"></div>
    </div>

    <!-- 右侧支付合作板块 -->
    <div
        class="info-panel payment-panel"
        @mouseenter="hoverIndex = 2"
        @mouseleave="hoverIndex = -1"
        @click="handlePanelClick(2)"
    >
      <div class="panel-logos">
        <img src="https://manage.kiku001.top/static/img/logo.eab481b0.png" class="logo" alt="正式出道">
        <el-icon><Close /></el-icon>
        <img src="https://www.kiku001.top/vite.svg" class="logo" alt="正式出道">
      </div>
      <div class="panel-content">
        <h3 class="panel-title">正式出道</h3>
        <p class="panel-desc">在 SNH48 星梦剧院的公演 《剧场女神》 中首次登台演出，这一天被视为她的正式出道日。</p>
      </div>
      <div class="panel-date">2013年11月2日</div>
      <div class="panel-hover-overlay"></div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { Close } from '@element-plus/icons-vue'

const hoverIndex = ref(-1)

const handlePanelClick = (index) => {
  console.log(`点击了第${index + 1}个面板`)
  // 这里可以添加路由跳转或弹窗显示详情等逻辑
}
</script>

<style scoped>
.info-panel-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.info-panel {
  position: relative;
  border-radius: 0; /* 去掉圆角 */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 380px;
  background: white;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
}

.info-panel:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 通用面板样式 */
.panel-content {
  padding: 20px;
  flex: 1;
  z-index: 2;
}

.panel-title {
  font-size: 1.2rem;
  margin-bottom: 12px;
  line-height: 1.4;
  font-weight: 500;
  transition: all 0.3s ease;
}

.panel-desc {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
  transition: all 0.3s ease;
}

.panel-date {
  padding: 12px 20px;
  font-size: 0.8rem;
  font-weight: 500;
  background: #f8f8f8;
  color: #666;
  z-index: 2;
}

/* 悬停覆盖层 */
.panel-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 100, 255, 0);
  transition: all 0.3s ease;
  z-index: 1;
}

.info-panel:hover .panel-hover-overlay {
  background: rgba(0, 100, 255, 0.05);
}

/* 左侧和中间图片面板 */
.left-panel,
.image-panel {
  padding: 0;
}

.left-panel {
  border-top: 4px solid #0064ff; /* 保持蓝色标识 */
}

.image-panel {
  border-top: 4px solid #07C160; /* 绿色标识 */
}

.panel-image {
  position: relative;
  height: 160px;
  overflow: hidden;
}

.panel-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease;
}

.left-panel:hover .panel-image img,
.image-panel:hover .panel-image img {
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.image-overlay.hover {
  background: rgba(0, 0, 0, 0.4);
}

/* 右侧支付面板 */
.payment-panel {
  border-top: 4px solid #FF9500; /* 橙色标识 */
}

.panel-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 30px 20px;
  background: #f8f8f8;
  transition: all 0.3s ease;
}

.payment-panel:hover .panel-logos {
  background: #f0f0f0;
}

.panel-logos .el-icon {
  font-size: 20px;
  color: #999;
  transition: all 0.3s ease;
}

.payment-panel:hover .panel-logos .el-icon {
  transform: rotate(90deg);
}

.logo {
  height: 24px;
  object-fit: contain;
  transition: all 0.3s ease;
}

.payment-panel:hover .logo {
  transform: scale(1.05);
}

/* 响应式设计 */
@media (max-width: 992px) {
  .info-panel-container {
    grid-template-columns: 1fr;
  }

  .info-panel {
    height: auto;
    margin-bottom: 24px;
  }

  .panel-image {
    height: 200px;
  }
}
</style>
